package com.lfk.three.static_info;

import com.lfk.three.item.User_Item;
import com.lfk.three.utils.database.DataBase;
import com.lfk.three.utils.tools.SpUtils;
import com.qiniu.util.Auth;

/**
 * Created by liufengkai on 16/4/9.
 */
public class static_info {
    public static String user_id = null;

    public static String user_name = null;

    public static String user_phone = null;

    public static String user_token = null;

    public static boolean user_sex;

    public static String user_sign = null;

    public static String user_image = null;

    public static String user_verify = null;

    public static final int UPLOAD_PIC = 3;

    public static final int POST_DATA = 4;

    public static final int POST_DATA_NO_PARAMS = 5;

    public static DataBase content_database = null;

    public static Auth user_auth = null;

    private final static String bucket = "lfkdsk";

    public static void initUserInfo(User_Item item) {
        user_name = item.name;
        user_id = item.id;
        user_sex = item.sex;
        user_phone = item.phone;
        user_token = item.pwd;
        user_image = item.avatar;
        user_sign = item.sign;

        SpUtils.put("user_name", user_name);
        SpUtils.put("user_id", user_id);
        SpUtils.put("user_sex", user_id);
        SpUtils.put("user_phone", user_phone);
        SpUtils.put("user_token", user_token);
        SpUtils.put("user_img", user_image);
        SpUtils.put("user_sign", user_sign);
    }

    public static String getToken() {
        return user_auth.uploadToken(bucket);
    }
}
